package org.htmlparser.visitors;

import org.htmlparser.Node;
import org.htmlparser.Tag;
import org.htmlparser.util.NodeList;

public class ObjectFindingVisitor extends NodeVisitor
{
  private Class classTypeToFind;
  private NodeList tags;

  public ObjectFindingVisitor(Class paramClass)
  {
    this(paramClass, true);
  }

  public ObjectFindingVisitor(Class paramClass, boolean paramBoolean)
  {
    super(paramBoolean, true);
    this.classTypeToFind = paramClass;
    this.tags = new NodeList();
  }

  public int getCount()
  {
    return this.tags.size();
  }

  public Node[] getTags()
  {
    return this.tags.toNodeArray();
  }

  public void visitTag(Tag paramTag)
  {
    if (paramTag.getClass().equals(this.classTypeToFind))
      this.tags.add(paramTag);
  }
}